package org.linuxgears.BouncingBall.model;

public class Point implements Cloneable {

	private double x;
	private double y;

	public Point() {
		this(0.0, 0.0);
	}
	
	public Point(double x, double y) {
		this.x = x;
		this.y = y;
	}
	
	public Point(int x, int y) {
		this((double)x, (double)y);
	}
		
	public Point(Point other) {
		this(other.x, other.y);
	}
	
	public double getX() {
		return x;
	}
	
	public void setX(double x) {
		this.x = x;
	}
	
	public void setX(int x) {
		this.x = x;
	}
	
	public void incX(int delta) {
		x += delta;
	}
	
	public void incX(double delta) {
		x += delta;
	}
	
	public void incY(int delta) {
		y += delta;
	}
	
	public void incY(double delta) {
		y += delta;
	}
	
	public double getY() {
		return y;
	}
	
	public void setY(double y) {
		this.y = y;
	}	

	public void setY(int y) {
		this.y = y;
	}	

	@Override
	public Point clone() {
		Point other = null;
		try {
			other = (Point)super.clone();
		} catch (CloneNotSupportedException ex) {	// shhh!
			
		}
		
		return other;
	}

	@Override
	public String toString() {
		return "[x=" + x + ", y=" + y + "]";
	}
}
